import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  UseGuards,
} from '@nestjs/common';
import { AdminuserService } from './adminuser.service';
import { CreateAdminuserDto } from './dto/create-adminuser.dto';
import { UpdateAdminuserDto } from './dto/update-adminuser.dto';
import { JwtAuthGuard } from '../auth/jwt-auth.guard';

@UseGuards(JwtAuthGuard)
@Controller('adminuser')
export class AdminuserController {
  constructor(private readonly adminuserService: AdminuserService) {}

  @Post()
  create(@Body() createAdminuserDto: CreateAdminuserDto) {
    return this.adminuserService.create(createAdminuserDto);
  }

  @Get()
  findAll() {
    return this.adminuserService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.adminuserService.findOne(+id);
  }

  @Patch(':id')
  update(
    @Param('id') id: string,
    @Body() updateAdminuserDto: UpdateAdminuserDto,
  ) {
    return this.adminuserService.update(+id, updateAdminuserDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.adminuserService.remove(+id);
  }
}
